<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>ECharts</title>
    <!-- 引入 echarts.js -->
    <script src="echarts.min.js"></script>
</head>
<body>
    <!-- 为ECharts准备一个具备大小（宽高）的Dom -->
    <div id="main" style="width:100%;height:400px;"></div>
    <script type="text/javascript">
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('main'));

        // 指定图表的配置项和数据
        var option = {
    title: {
        
    },
    tooltip: {
        trigger: 'axis'
    },
    legend: {
        data:['今天','昨天','一周前','一月前']
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    toolbox: {
        feature: {
            saveAsImage: {}
        }
    },
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data : ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24']
    },
    yAxis: {
        type: 'value'
    },
    series: [
        {
            name:'今天',
            type:'line',
            //stack: '总量',
            data:[10,0,20,20,20,30,40,50,60,100,150,150,180,220,250,260,300,280,250,300,310,180,100,10]
        },
        {
            name:'昨天',
            type:'line',
            //stack: '总量',
            data:[20,10,10,10,20,40,45,58,60,110,120,190,180,240,210,270,310,288,257,310,320,190,100,10]
        },
        {
            name:'一周前',
            type:'line',
            //stack: '总量',
            data:[10,0,20,20,20,30,100,180,180,200,220,180,180,220,250,260,300,280,250,300,310,180,100]
        },
        {
            name:'一月前',
            type:'line',
            //stack: '总量',
            data:[10,0,25,25,25,30,100,190,200,200,220,180,180,220,250,290,330,280,250,300,310,250,10]
        },
        
    ]
};


        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
    </script>
</body>
</html>